package com.bjsxt;

import java.util.Objects;

/**
 * 经理
 *
 * @author melo
 */
public class Manager extends Leader {

    public Manager(String name) {
        super(name);
    }

    @Override
    public void handleRequest(LeaveRequest leaveRequest) {
        if (leaveRequest.getLeaveDays() < 10) {
            System.out.println("员工：" + leaveRequest.getEmployeeName() + "请假，天数：" + leaveRequest.getLeaveDays() + ",理由：" + leaveRequest.getReason());
            System.out.println(this.name + "经理请假审批通过");
        } else {
            if (Objects.nonNull(this.nextLeader)) {
                this.nextLeader.handleRequest(leaveRequest);
            }
        }
    }

}
